Skip to content

Allow F_CPU redefinition #613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 27, 2019
Merged

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Aug 26, 2019

To avoid any issue with F_CPU value, it is defined by default to
SystemCoreClock value which is updated automatically after each
clock configuration update.

Some libraries use F_CPU at build time for conditional purpose (ex to #612).
This commit allow to redefine it at build time using build_opt.h or hal_conf_extra.h:
https://github.com/stm32duino/wiki/wiki/Custom-definitions
then it will be possible to define it as a constant.

Important note:
User have to ensure to set it to the proper value.

To avoid any issue with `F_CPU` value, it is defined by default to
`SystemCoreClock` value which is updated automatically after each
clock configuration update.

Some libraries use `F_CPU` at build time for conditional purpose
(ex to stm32duino#612).
This commit allow to redefine it at build time using `build_opt.h`
or `hal_conf_extra.h`:
https://github.com/stm32duino/wiki/wiki/Custom-definitions
then it will be possible to define it as a constant.

Important note:
**User have to ensure to set it to the proper value.**

Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm fpistm added this to the 1.7.0 milestone Aug 26, 2019
@fpistm fpistm self-assigned this Aug 26, 2019
@fpistm fpistm added arduino compatibility enhancement New feature or request labels Aug 27, 2019
@fpistm fpistm merged commit a107d29 into stm32duino:master Aug 27, 2019
@fpistm fpistm deleted the F_CPU_Redefinition branch August 27, 2019 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant